package com.glsc.ngateway.common.base.domain.mysql.gateway.other;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author libj
 * @date 2021/02/02
 * 标签信息表
 */
@Data
@ToString
@Entity
@Table(name = "t_am_tag")
public class Tag implements Serializable {
    @ApiModelProperty(value = "tagId")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "tag_id")
    private Integer tagId;


    @ApiModelProperty(value = "标签名称 tag_name")
    @Column(name = "tag_name", columnDefinition = "varchar(50) COMMENT '标签名称'")
    protected String tagName;

    @ApiModelProperty(value = "标签分组 字典：am_tag_group")
    @Column(name = "tag_group", columnDefinition = "varchar(20) COMMENT '标签分组'")
    protected String tagGroup;

    @ApiModelProperty(value = "排序号")
    @Column(name = "sort_no", columnDefinition = "varchar(10) COMMENT '排序号'")
    protected Integer sortNo;

    @ApiModelProperty(value = "产品配置方式 字典：am_tag_select_prod_method")
    @Column(name = "select_prod_method", columnDefinition = "varchar(10) COMMENT '产品配置方式'")
    protected String selectProdMethod;

    @ApiModelProperty(value = "自动配置SQL'")
    @Column(name = "select_prod_sql", columnDefinition = "varchar(512) COMMENT '自动配置SQL'")
    protected String selectProdSql;

    @ApiModelProperty(value = "删除状态，字典 YesNo:（N=未删除(默认) Y=已删除)")
    @Column(name = "tag_deleted", columnDefinition = "varchar(20) default 'N' COMMENT '删除状态，字典 yesno (N=否(默认) Y=是)'")
    protected String tagDeleted;

    @ApiModelProperty(value = "标签备注")
    @Column(name = "remark", columnDefinition = "varchar(200) COMMENT '标签备注'")
    protected String remark;

    @ApiModelProperty(value = "标签编码")
    @Column(name = "tag_code", columnDefinition = "varchar(50) COMMENT '标签编码'")
    protected String tagCode;

    @ApiModelProperty(value = "操作动作(增加、修改)")
    @Column(name = "op_action", columnDefinition = "varchar(32) COMMENT '操作动作(增加、修改)'")
    protected String opAction;

    @ApiModelProperty(value = "操作人员ID")
    @Column(name = "op_operator", columnDefinition = "varchar(20) COMMENT '操作人员ID'")
    protected String opOperator;

    @ApiModelProperty(value = "操作来源")
    @Column(name = "op_source", columnDefinition = "varchar(32) COMMENT '操作来源'")
    protected String opSource;

    @ApiModelProperty(value = "操作时间 yyyy-MM-dd HH:mm:ss")
    @Column(name = "op_time", columnDefinition = "datetime comment '操作时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime opTime;
}



